package com.chen.controller;

import com.chen.base.utils.R;
import com.chen.service.AdminHomeService;
import com.chen.vo.HomeInfoDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 后台首页信息获取接口
 */
@Controller
@RequestMapping("/adminHome")
public class AdminHomeController {

    @Autowired
    private AdminHomeService adminHomeService;

    @ResponseBody
    @GetMapping("/homeInfo")
    public R<HomeInfoDTO> homeInfo() {
        HomeInfoDTO homeInfo = adminHomeService.getHomeInfo();
        return R.<HomeInfoDTO>ok().data(homeInfo);
    }

}
